package com.santu.edu.supporter.biz.order.other.pojo.po;

import com.santu.edu.supporter.biz.order.other.pojo.dto.OtherOrderDTO;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @TableName edu_supporter_order_other
 */
@Data
@Accessors(chain = true)
public class OtherOrderPO implements Serializable {
    /**
     *
     */
    private Long id;

    /**
     * 学校id
     */
    private String schoolId;

    /**
     * 订单号
     */
    private String orderId;

    /**
     * 用户id(发起人)
     */
    private String userId;

    /**
     * 事情标题
     */
    private String title;

    /**
     * 事情描述
     */
    private String description;

    /**
     * 费用
     */
    private Long money;

    /**
     * 订单状态[0:待认领1:进行中2:已完成]
     */
    private Integer orderType;

    /**
     * 完成的状态[0:帮助人已完成2:顾客已确认]
     */
    private Integer taskType;

    /**
     *
     */
    private String gmtCreate;

    /**
     *
     */
    private String gmtModified;

    private static final long serialVersionUID = 1L;

    public static OtherOrderPO createItem(OtherOrderDTO dto) {
        return new OtherOrderPO()
                .setSchoolId(dto.getSchoolId())
                .setOrderId(dto.getOrderId())
                .setUserId(dto.getUserId())
                .setTitle(dto.getTitle())
                .setDescription(dto.getDescription())
                .setMoney(dto.getMoney())
                .setOrderType(dto.getOrderType().getCode())
                .setTaskType(dto.getTaskType().getCode());
    }
}